<?php
// $Id$
/**
 * This file contains {@link LockType} which is part of the PHP Content
 * Repository (phpCR), a derivative of the Java Content Repository JSR-170,  
 * and is licensed under the Apache License, Version 2.0.
 *
 * This file is based on the code created for
 * {@link http://www.jcp.org/en/jsr/detail?id=170 JSR-170}
 *
 * @author Travis Swicegood <travis@domain51.net>
 * @copyright PHP Code Copyright &copy; 2004-2005, Domain51, United States
 * @copyright Original Java and Documentation 
 *  Copyright &copy; 2002-2004, Day Management AG, Switerland
 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, 
 *      Version 2.0
 * @package phpContentRepository
 * @subpackage Level2
 */


/**
 * Load the {@link phpCR} library file(s)
 */ 
require_once(dirname(__FILE__) . '/../phpCR.library.php');
phpCR::loadInterface('Lock', '/lock');


/**
 * The lock types defined by the JCR standard.
 *
 * Level 2 only
 *
 * This interface defines the following lock type:
 * <ul>
 *    <li>WRITE_LOCK</li>
 * </ul>
 *
 * Implementations of the phpCR standard may support additional lock types.
 *
 * @author PHP - Travis Swicegood <travis@domain51.net>
 * @copyright Copyright &copy; 2004-2005, Domain51
 * @package phpContentRepository
 * @subpackage Level2
 */
interface LockType 
{
   /**
    * If a lock of this type is put on an {@link Item} then any attempt to
    * write to the item (i.e., add a child {@link Node} or {@link Property} to 
    * a {@link Node}, or set the value of a {@link Property}) will throw an
    * {@link AccessDeniedException} if the user of the {@link Ticket} attempting
    * to perform the operation is not an owner of the {@link Lock}.
    */
    const WRITE_LOCK = 1;
    
    
   /**
    * Returns the numerical constant identifying this lock type.
    *
    * @see LockCapabilities::getSupportedLockTypes()
    * @return int
    *   The numerical value
    */
    public function getValue();
    
    
   /**
    * Returns the descriptive name of this lock type.
    *
    * @see LockCapabilities::getSupportedLockTypes()
    * @return string
    *   The name
    */
    public function getName();
}

